// pc
function pcGSAPAnimateInit() {
    // kv Begin
    // /*
    //观看影片
    $(".one-kv-play-btn").click(function () {
      $(".one-video-playDiv").css("display", "flex");
      var src = $(this).attr("data-one-src");
      $(".one-video-playDiv-wrapper").html(
        '<video src="' +
        src +
        '" id="one-video-playDiv-video" class="one-video-playDiv-video" playsinline="true" webkit-playsinline="true" preload="none" controls="controls"></video>'
      );
      $("#one-video-playDiv-video")[0].play();
    });
    $(".one-video-playDiv-closeBtn").click(function () {
      $(".one-video-playDiv").hide();
      $("#one-video-playDiv-video")[0].pause();
      $(".one-video-playDiv-wrapper").html();
    });
    setTimeout(() => {
      $(".one-kv-txt1").addClass("active");
    }, 1500);
  
    var number = 0;
    var numberInterval;
    ScrollTrigger.create({
      trigger: ".one-kv-num",
      start: "top bottom",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-kv-section", {
        onStart: function () {
          if (numberInterval) {
            clearInterval(numberInterval);
            numberInterval = null;
          }
          number = 0;
          numberInterval = setInterval(function () {
            number += 1;
            if (number >= 6) {
              number = 6;
              if (numberInterval) {
                clearInterval(numberInterval);
                numberInterval = null;
              }
            }
            $(".one-kv-num span").text(number);
          }, 100);
  
          $(".one-kv-card2").addClass("active");
          $(".one-kv-card3").addClass("active");
        },
      }),
    });
  
    // */
    // kv End
  
    // trophy Begin
    // /*
    new Swiper(".one-trophy-swiper", {
      noSwipingClass: "one-trophy-swiper",
      centeredSlides: true,
      centeredSlidesBounds: true,
      loop: true,
      spaceBetween: 0,
      loopAdditionalSlides: 2,
      autoplay: {
        delay: 1500, // 设置轮播的延迟时间
        disableOnInteraction: true,
      },
      on: {
        slideChangeTransitionStart: function () {
          $(".one-trophy-swiper-item").removeClass("active");
          $(".one-trophy-swiper-item").eq(this.activeIndex).addClass("active");
        },
      },
      // navigation: {
      //   prevEl: ".one-trophy-swiperList .one-trophy-left",
      //   nextEl: ".one-trophy-swiperList .one-trophy-right",
      //   disabledClass: "disabled",
      // },
    });
    // */
    // trophy End
  
    // color Begin
    // /*
    var colorVideos = $(".one-color-section video");
    $(".one-color-btn").click(function () {
      if ($(this).hasClass("active")) {
        return;
      }
      $(".one-color-btn").removeClass("active");
      $(this).addClass("active");
  
      $(".one-color-video").toggleClass("active");
      const index = $(this).data("index");
      colorVideos[index].currentTime = 0;
      colorVideos[index].play();
    });
    // */
    // color End
  
    // fixnav Begin
    // /*
    ScrollTrigger.create({
      trigger: ".one-fixnav-section-top",
      start: "top 5%",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-fixnav-section", {
        onStart: function () {
          $(".one-fixnav-section").addClass("active");
        },
        onReverseComplete: function () {
          $(".one-fixnav-section").removeClass("active");
        },
      }),
    });
  
    ScrollTrigger.create({
      trigger: ".one-arscene-section",
      start: "top top",
      end: "+=1",
      scrub: true,
      animation: gsap.timeline().to(".one-fixnav-section", {
        onStart: function () {
          $(".one-fixnav-section .one-fixnav-btn").removeClass("active");
          $(".one-fixnav-section .one-fixnav-btn").eq(0).addClass("active");
        },
      }),
    });
    ScrollTrigger.create({
      trigger: ".one-bigscreen-section",
      start: "top top",
      end: "+=1",
      scrub: true,
      animation: gsap.timeline().to(".one-fixnav-section", {
        onStart: function () {
          $(".one-fixnav-section .one-fixnav-btn").removeClass("active");
          $(".one-fixnav-section .one-fixnav-btn").eq(1).addClass("active");
        },
        onReverseComplete: function () {
          $(".one-fixnav-section .one-fixnav-btn").removeClass("active");
          $(".one-fixnav-section .one-fixnav-btn").eq(0).addClass("active");
        },
      }),
    });
    ScrollTrigger.create({
      trigger: ".one-precision-section",
      start: "top top",
      end: "+=1",
      scrub: true,
      animation: gsap.timeline().to(".one-fixnav-section", {
        onStart: function () {
          $(".one-fixnav-section .one-fixnav-btn").removeClass("active");
          $(".one-fixnav-section .one-fixnav-btn").eq(2).addClass("active");
        },
        onReverseComplete: function () {
          $(".one-fixnav-section .one-fixnav-btn").removeClass("active");
          $(".one-fixnav-section .one-fixnav-btn").eq(1).addClass("active");
        },
      }),
    });
    ScrollTrigger.create({
      trigger: ".one-eyeglasses-section",
      start: "top top",
      end: "+=1",
      scrub: true,
      animation: gsap.timeline().to(".one-fixnav-section", {
        onStart: function () {
          $(".one-fixnav-section .one-fixnav-btn").removeClass("active");
          $(".one-fixnav-section .one-fixnav-btn").eq(3).addClass("active");
        },
        onReverseComplete: function () {
          $(".one-fixnav-section .one-fixnav-btn").removeClass("active");
          $(".one-fixnav-section .one-fixnav-btn").eq(2).addClass("active");
        },
      }),
    });
    ScrollTrigger.create({
      trigger: ".one-box-partner-section",
      start: "top top",
      end: "+=1",
      scrub: true,
      animation: gsap.timeline().to(".one-fixnav-section", {
        onStart: function () {
          $(".one-fixnav-section .one-fixnav-btn").removeClass("active");
          $(".one-fixnav-section .one-fixnav-btn").eq(4).addClass("active");
        },
        onReverseComplete: function () {
          $(".one-fixnav-section .one-fixnav-btn").removeClass("active");
          $(".one-fixnav-section .one-fixnav-btn").eq(3).addClass("active");
        },
      }),
    });
    // */
    // fixnav End
  
    // arscene Begin
    // /*
    // ScrollTrigger.create({
    //   trigger: ".one-arscene-section",
    //   start: "top 25%",
    //   end: "top top",
    //   scrub: true,
    //   animation: gsap
    //     .timeline()
    //     .fromTo(".one-arscene-swiper", { height: "50rem" }, { height: "100%" })
    //     .to(".one-arscene-title", { opacity: 0, marginTop: "-5rem" }, "<"),
    // });
  
    // ScrollTrigger.create({
    //   trigger: ".one-arscene-section",
    //   start: "top top",
    //   end: "+=10",
    //   scrub: true,
    //   animation: gsap.timeline().to(".one-arscene-section", {
    //     onStart: function () {
    //       $(".one-arscene-box").addClass("active");
    //     },
    //     onReverseComplete: function () {
    //       $(".one-arscene-box").removeClass("active");
    //     },
    //   }),
    // });
    // ScrollTrigger.create({
    //   trigger: ".one-arscene-section",
    //   start: "bottom bottom",
    //   end: "+=10",
    //   scrub: true,
    //   animation: gsap.timeline().to(".one-arscene-section", {
    //     onStart: function () {
    //       $(".one-arscene-box").css({ position: "absolute" });
    //     },
    //     onReverseComplete: function () {
    //       $(".one-arscene-box").css({ position: "fixed" });
    //     },
    //   }),
    // });
  
    new Swiper(".one-arscene-swiper", {
      spaceBetween: 0,
      autoplay: {
        delay: 3000, // 设置轮播的延迟时间
        disableOnInteraction: true,
      },
      on: {
        slideChangeTransitionStart: function () {
          $(".one-arscene-btn").removeClass("active");
          $(".one-arscene-btn").eq(this.activeIndex).addClass("active");
  
          $(".one-arscene-name p").removeClass("active");
          $(".one-arscene-name p").eq(this.activeIndex).addClass("active");
        },
      },
      pagination: {
        type: "custom",
        clickable: true,
        el: ".one-arscene-btnBox",
        bulletClass: "one-arscene-btn",
      },
    });
    // */
    // arscene End
  
    // triplescreen Begin
    // /*
    var triplescreenVideo = $(".one-triplescreen-section video")[0];
    ScrollTrigger.create({
      trigger: ".one-triplescreen-section",
      start: "top 70%",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-triplescreen-section", {
        onStart: function () {
          triplescreenVideo.currentTime = 0;
          triplescreenVideo.play();
        },
        onReverseComplete: function () {
          triplescreenVideo.currentTime = 0;
        },
      }),
    });
    // */
    // triplescreen End
  
    // bigscreen Begin
    // /*
    ScrollTrigger.create({
      trigger: ".one-bigscreen-section",
      start: "top top",
      end: "1500",
      pin: true,
    });
    ScrollTrigger.create({
      trigger: ".one-bigscreen-section",
      start: "top top",
      end: "1500",
      scrub: true,
      animation: gsap
        .timeline()
        .fromTo(".one-bigscreen-filter", { opacity: 0 }, { opacity: 1 })
        .fromTo(
          ".one-bigscreen-content",
          { marginTop: "5rem", opacity: 0 },
          { marginTop: "0em", opacity: 1 }
        ),
    });
    // */
    // bigscreen End
  
    // dof Begin
    // /*
    var dofVideo = $(".one-dof-section video")[0];
    ScrollTrigger.create({
      trigger: ".one-dof-section",
      start: "top 70%",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-dof-section", {
        onStart: function () {
          dofVideo.currentTime = 0;
          dofVideo.play();
        },
        onReverseComplete: function () {
          dofVideo.currentTime = 0;
        },
      }),
    });
    // */
    // dof End
  
    // operationsynthesis Begin
    // /*
    var operationsynthesisVideo = $(".one-operationsynthesis-section video")[0];
    ScrollTrigger.create({
      trigger: ".one-operationsynthesis-section",
      start: "top 70%",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-operationsynthesis-section", {
        onStart: function () {
          operationsynthesisVideo.currentTime = 0;
          operationsynthesisVideo.play();
        },
        onReverseComplete: function () {
          operationsynthesisVideo.currentTime = 0;
        },
      }),
    });
    // */
    // operationsynthesis End
  
    // eyeprotection Begin
    // /*
    ScrollTrigger.create({
      trigger: ".one-eyeprotection-section",
      start: "top top",
      end: "1000",
      pin: true,
    });
    ScrollTrigger.create({
      trigger: ".one-eyeprotection-section-top",
      start: "top+=200 top",
      end: "+=800",
      scrub: true,
      animation: gsap
        .timeline()
        .fromTo(
          ".one-eyeprotection-img",
          { opacity: 0.99 },
          {
            opacity: 1,
            duration: 0.001,
            onStart: function () {
              $(".one-eyeprotection-section").addClass("active");
            },
            onReverseComplete: function () {
              $(".one-eyeprotection-section").removeClass("active");
            },
          }
        )
        .fromTo(
          ".one-eyeprotection-iconBox",
          { opacity: 0 },
          {
            opacity: 1,
            duration: 0.001,
            onStart: function () {
              $(".one-eyeprotection-iconBox").addClass("active");
            },
            onReverseComplete: function () {
              $(".one-eyeprotection-iconBox").removeClass("active");
            },
          },
          ">"
        ),
    });
    // */
    // eyeprotection End
  
    // model Begin
    // /*
    new Swiper(".one-model-swiper", {
      effect: "fade",
      autoplay: {
        delay: 3000, // 设置轮播的延迟时间
        disableOnInteraction: true,
      },
      on: {
        slideChangeTransitionStart: function () {
          $(".one-model-btn").removeClass("active");
          $(".one-model-btn").eq(this.activeIndex).addClass("active");
          $(".one-model-item").removeClass("active");
          $(".one-model-item").eq(this.activeIndex).addClass("active");
          $(".one-model-svg>svg").removeClass("active");
          $(".one-model-svg>svg").eq(this.activeIndex).addClass("active");
        },
      },
      pagination: {
        type: "custom",
        clickable: true,
        el: ".one-model-btnList",
        bulletClass: "one-model-btn",
      },
    });
    // */
    // model End
  
    // 3d Begin
    // /*
    // ScrollTrigger.create({
    //   trigger: ".one-3d-section",
    //   start: "bottom bottom",
    //   end: "bottom 90%",
    //   scrub: true,
    //   animation: gsap
    //     .timeline()
    //     .fromTo(".one-3d-filter", { opacity: 0 }, { opacity: 1 })
    //     .fromTo(
    //       ".one-3d-txt",
    //       { marginTop: "5rem", opacity: 0 },
    //       { marginTop: "0em", opacity: 1 }
    //     ),
    // });
    // */
    // 3d End
  
    // precision Begin
    // /*
    $(".one-precision-title p").eq("0").addClass("active");
    $(".one-precision-btn").eq("0").addClass("active");
    $(".one-precision-des p").eq("0").addClass("active");
    new Swiper(".one-precision-swiper", {
      spaceBetween: 0,
      autoplay: {
        delay: 3000, // 设置轮播的延迟时间
        disableOnInteraction: true,
      },
      on: {
        slideChangeTransitionStart: function () {
          $(".one-precision-btn").removeClass("active");
          $(".one-precision-btn").eq(this.activeIndex).addClass("active");
          $(".one-precision-text>p").removeClass("active");
          $(".one-precision-text>p").eq(this.activeIndex).addClass("active");
          $(".one-precision-des>p").removeClass("active");
          $(".one-precision-des>p").eq(this.activeIndex).addClass("active");
          $(".one-precision-title>p").removeClass("active");
          $(".one-precision-title>p").eq(this.activeIndex).addClass("active");
        },
      },
      pagination: {
        type: "custom",
        clickable: true,
        el: ".one-precision-btnList",
        bulletClass: "one-precision-btn",
      },
    });
    // */
    // precision End
  
    // system Begin
    // /*
    var systemVideo1 = $(".one-system-img1 video")[0];
    ScrollTrigger.create({
      trigger: ".one-system-img1",
      start: "top 75%",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-system-section", {
        onStart: function () {
          systemVideo1.currentTime = 0;
          systemVideo1.play();
        },
        onReverseComplete: function () {
          systemVideo1.currentTime = 0;
        },
      }),
    });
    var systemVideos = $(".one-system-img2 video");
    ScrollTrigger.create({
      trigger: ".one-system-item",
      start: "top 70%",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-system-section", {
        onStart: function () {
          systemVideos[0].currentTime = 0;
          systemVideos[1].currentTime = 0;
          systemVideos[0].play();
          systemVideos[1].play();
        },
        onReverseComplete: function () {
          systemVideos[0].currentTime = 0;
          systemVideos[1].currentTime = 0;
        },
      }),
    });
    // */
    // system End
  
    // eyeglasses Begin
    // /*
    $(".one-eyeglasses-btn").eq(0).addClass("active");
    // $(".one-eyeglasses-button").click(function () {
    //   $(".one-eyeglasses-popup").addClass("active");
    //   eyeglassesSwiper.enable();
    //   $(".one-eyeglasses-imgDiv picture").hide();
    // });
    // $(".one-eyeglasses-nopopup").click(function () {
    //   $(".one-eyeglasses-popup").removeClass("active");
    //   eyeglassesSwiper.disable();
    //   $(".one-eyeglasses-imgDiv picture").show();
    // });
  
    ScrollTrigger.create({
      trigger: ".one-eyeglasses-imgDiv",
      start: "top bottom",
      end: "70% bottom",
      toggleActions: "none play none reset",
      animation: gsap
        .timeline()
        .fromTo(
          ".one-eyeglasses-img-2",
          { marginLeft: "0em", top: "20.85rem", opacity: 0 },
          { marginLeft: "-14rem", top: "6rem", opacity: 1 }
        )
        .fromTo(
          ".one-eyeglasses-img-3",
          { marginLeft: "0em", top: "20.85rem", opacity: 0 },
          { marginLeft: "-32.25rem", top: "13.75rem", opacity: 1 },
          "<"
        )
        .fromTo(
          ".one-eyeglasses-img-4",
          { marginLeft: "0em", top: "20.85rem", opacity: 0 },
          { marginLeft: "-30.25rem", top: "31.85rem", opacity: 1 },
          "<"
        )
        .fromTo(
          ".one-eyeglasses-img-5",
          { marginLeft: "0em", top: "20.85rem", opacity: 0 },
          { marginLeft: "-14.75rem", top: "42.35rem", opacity: 1 },
          "<"
        )
        .fromTo(
          ".one-eyeglasses-img-6",
          { marginLeft: "0em", top: "20.85rem", opacity: 0 },
          { marginLeft: "15.25rem", top: "4.75rem", opacity: 1 },
          "<"
        )
        .fromTo(
          ".one-eyeglasses-img-7",
          { marginLeft: "0em", top: "20.85rem", opacity: 0 },
          { marginLeft: "32.75rem", top: "17.25rem", opacity: 1 },
          "<"
        )
        .fromTo(
          ".one-eyeglasses-img-8",
          { marginLeft: "0em", top: "20.85rem", opacity: 0 },
          { marginLeft: "29rem", top: "31.85rem", opacity: 1 },
          "<"
        )
        .fromTo(
          ".one-eyeglasses-img-9",
          { marginLeft: "0em", top: "20.85rem", opacity: 0 },
          { marginLeft: "18.25rem", top: "39.05rem", opacity: 1 },
          "<"
        )
        .fromTo(".one-eyeglasses-button", { opacity: 0 }, { opacity: 1 }, "<"),
    });
  
    window.ONE.initPopup(".one-eyeglasses-button", ".one-eyeglasses-popup");
    // */
    // eyeglasses End
  
    // partner Begin
    // /*
  
    new Swiper(".one-partner-swiper", {
      noSwipingClass: "one-partner-swiper",
      centeredSlides: true,
      centeredSlidesBounds: true,
      loop: true,
      spaceBetween: 0,
      loopAdditionalSlides: 2,
      autoplay: {
        delay: 3000, // 设置轮播的延迟时间
        disableOnInteraction: true,
      },
      on: {
        slideChangeTransitionStart: function () {
          $(".one-partner-swiper-item").removeClass("active");
          $(".one-partner-swiper-item").eq(this.activeIndex).addClass("active");
        },
      },
      navigation: {
        prevEl: ".one-partner-swiperList .one-partner-left",
        nextEl: ".one-partner-swiperList .one-partner-right",
        disabledClass: "disabled",
      },
    });
  
    // */
    // partner End
  
    // review Begin
    // /*
    new Swiper(".one-review-swiper", {
      effect: "fade",
      autoplay: {
        delay: 3000, // 设置轮播的延迟时间
        disableOnInteraction: true,
      },
      spaceBetween: 20,
      navigation: {
        prevEl: ".one-review-pagebtn.left",
        nextEl: ".one-review-pagebtn.right",
        disabledClass: "disabled",
      },
    });
    // */
    // review End
  }
  // wap
  function wapGSAPAnimateInit() {
    // kv Begin
    // /*
    //观看影片
    $(".one-kv-play-btn").click(function () {
      $(".one-video-playDiv").css("display", "flex");
      var src = $(this).attr("data-one-src");
      $(".one-video-playDiv-wrapper").html(
        '<video src="' +
        src +
        '" id="one-video-playDiv-video" class="one-video-playDiv-video" playsinline="true" webkit-playsinline="true" preload="none" controls="controls"></video>'
      );
      $("#one-video-playDiv-video")[0].play();
    });
    $(".one-video-playDiv-closeBtn").click(function () {
      $(".one-video-playDiv").hide();
      $("#one-video-playDiv-video")[0].pause();
      $(".one-video-playDiv-wrapper").html();
    });
    setTimeout(() => {
      $(".one-kv-txt1").addClass("active");
    }, 2000);
    var kvAnimate;
    ScrollTrigger.create({
      trigger: ".one-kv-img",
      start: "top bottom",
      animation: gsap.timeline().to(".one-kv-img", {
        onStart: function () {
          window.ONE.keyAnimate(".one-kv-img", 1, 57, 20).then(function (re) {
            kvAnimate = re;
            kvAnimate?.from(1, 1);
          });
        },
      }),
    });
  
    var number = 0;
    var numberInterval;
    ScrollTrigger.create({
      trigger: ".one-kv-num",
      start: "top bottom",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-kv-section", {
        onStart: function () {
          if (numberInterval) {
            clearInterval(numberInterval);
            numberInterval = null;
          }
          number = 0;
          numberInterval = setInterval(function () {
            number += 1;
            if (number >= 6) {
              number = 6;
              if (numberInterval) {
                clearInterval(numberInterval);
                numberInterval = null;
              }
            }
            $(".one-kv-num span").text(number);
          }, 100);
        },
      }),
    });
    // */
    // kv End
  
    // trophy Begin
    // /*
    var trophySwiper = new Swiper(".one-trophy-swiper", {
      slidesPerView: 5,
      centeredSlides: true,
      loop: true,
      spaceBetween: 0,
      autoplay: {
        delay: 1500, // 设置轮播的延迟时间
        disableOnInteraction: true,
      },
      on: {
        slideChangeTransitionStart: function () {
          $(".one-trophy-swiper-item").removeClass("active");
          $(".one-trophy-swiper-item").eq(this.activeIndex).addClass("active");
        },
      },
      // navigation: {
      //   prevEl: ".one-trophy-swiperList .one-trophy-left",
      //   nextEl: ".one-trophy-swiperList .one-trophy-right",
      //   disabledClass: "disabled",
      // },
    });
    // */
    // trophy End
  
    // color Begin
    // /*
    var colorVideos = [];
    $(".one-color-btn").click(function () {
      if ($(this).hasClass("active")) {
        return;
      }
      $(".one-color-btn").removeClass("active");
      $(this).addClass("active");
  
      $(".one-color-img").toggleClass("active");
      const index = $(this).data("index");
  
      if (colorVideos[index]) {
        colorVideos[index].from(1, 1);
      } else {
        window.ONE.keyAnimate(`.one-color-img${index + 1}`, 1, 45, 20).then(
          function (re) {
            colorVideos[index] = re;
            colorVideos[index]?.from(1, 1);
          }
        );
      }
    });
  
    ScrollTrigger.create({
      trigger: ".one-kv-section",
      start: "top 70%",
      end: "+=10",
      animation: gsap.timeline().to(".cbcn-kv-section", {
        onStart: () => {
          window.ONE.keyAnimate(`.one-color-img1`, 1, 45, 20).then(function (re) {
            colorVideos[0] = re;
            colorVideos[0]?.from(1, 1);
          });
          window.ONE.keyAnimate(`.one-color-img2`, 1, 46, 20).then(function (re) {
            colorVideos[1] = re;
            colorVideos[1]?.from(1, 1);
          });
        },
      }),
    });
    // */
    // color End
  
    // fixnav Begin
    // /*
    ScrollTrigger.create({
      trigger: ".one-fixnav-section-top",
      start: "top 15%",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".cbcn-fixnav-section", {
        onStart: function () {
          $(".one-fixnav-section").addClass("active");
        },
        onReverseComplete: function () {
          $(".one-fixnav-section").removeClass("active");
        },
      }),
    });
  
    ScrollTrigger.create({
      trigger: ".one-arscene-section",
      start: "top top+=10",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".cbcn-fixnav-section", {
        onStart: function () {
          $(".one-fixnav-section .one-fixnav-btn").eq(0).click();
        },
      }),
    });
    ScrollTrigger.create({
      trigger: ".one-bigscreen-section",
      start: "top top+=10",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".cbcn-fixnav-section", {
        onStart: function () {
          $(".one-fixnav-section .one-fixnav-btn").eq(1).click();
        },
        onReverseComplete: function () {
          $(".one-fixnav-section .one-fixnav-btn").eq(0).click();
        },
      }),
    });
    ScrollTrigger.create({
      trigger: ".one-precision-section",
      start: "top top+=10",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".cbcn-fixnav-section", {
        onStart: function () {
          $(".one-fixnav-section .one-fixnav-btn").eq(2).click();
        },
        onReverseComplete: function () {
          $(".one-fixnav-section .one-fixnav-btn").eq(1).click();
        },
      }),
    });
    ScrollTrigger.create({
      trigger: ".one-eyeglasses-section",
      start: "top top+=10",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".cbcn-fixnav-section", {
        onStart: function () {
          $(".one-fixnav-section .one-fixnav-btn").eq(3).click();
        },
        onReverseComplete: function () {
          $(".one-fixnav-section .one-fixnav-btn").eq(2).click();
        },
      }),
    });
    ScrollTrigger.create({
      trigger: ".one-box-partner-section",
      start: "top top+=10",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".cbcn-fixnav-section", {
        onStart: function () {
          $(".one-fixnav-section .one-fixnav-btn").eq(4).click();
        },
        onReverseComplete: function () {
          $(".one-fixnav-section .one-fixnav-btn").eq(3).click();
        },
      }),
    });
  
    $(".one-fixnav-menu").click(function () {
      $(".one-fixnav-btnBox").toggleClass("active");
    });
    $(".one-fixnav-btn").click(function () {
      $(".one-fixnav-btn").removeClass("active");
      $(".one-fixnav-activeTxt").text($(this).text());
      $(this).addClass("active");
      $(".one-fixnav-btnBox").removeClass("active");
    });
    // */
    // fixnav End
  
    // arscene Begin
    // /*
    new Swiper(".one-arscene-swiper", {
      spaceBetween: 0,
      autoplay: {
        delay: 3000, // 设置轮播的延迟时间
        disableOnInteraction: true,
      },
      on: {
        slideChangeTransitionStart: function () {
          $(".one-arscene-btn").removeClass("active");
          $(".one-arscene-btn").eq(this.activeIndex).addClass("active");
  
          $(".one-arscene-name p").removeClass("active");
          $(".one-arscene-name p").eq(this.activeIndex).addClass("active");
        },
      },
      pagination: {
        type: "custom",
        clickable: true,
        el: ".one-arscene-btnBox",
        bulletClass: "one-arscene-btn",
      },
    });
    // */
    // arscene End
  
    // triplescreen Begin
    // /*
    var triplescreenAnimate;
    ScrollTrigger.create({
      trigger: ".one-triplescreen-section",
      start: "top 70%",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-triplescreen-img", {
        onStart: function () {
          window.ONE.keyAnimate(".one-triplescreen-img", 1, 50, 20).then(function (re) {
            triplescreenAnimate = re;
            triplescreenAnimate?.from(1, 1);
          });
        },
      }),
    });
    // */
    // triplescreen End
  
    // dof Begin
    // /*
    var dofAnimate;
    ScrollTrigger.create({
      trigger: ".one-dof-section",
      start: "top 70%",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-dof-img", {
        onStart: function () {
          window.ONE.keyAnimate(".one-dof-img", 1, 60, 20).then(function (re) {
            dofAnimate = re;
            dofAnimate?.from(1);
          });
        },
      }),
    });
    // */
    // dof End
  
    // operationsynthesis Begin
    // /*
    var operationsynthesisAnimate;
    ScrollTrigger.create({
      trigger: ".one-operationsynthesis-section",
      start: "top 70%",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-operationsynthesis-img", {
        onStart: function () {
          window.ONE.keyAnimate(".one-operationsynthesis-img", 1, 35, 20).then(function (re) {
            operationsynthesisAnimate = re;
            operationsynthesisAnimate?.from(1, 1);
          });
        },
      }),
    });
    // */
    // operationsynthesis End
  
    // model Begin
    // /*
    new Swiper(".one-model-swiper", {
      effect: "fade",
      autoplay: {
        delay: 3000, // 设置轮播的延迟时间
        disableOnInteraction: true,
      },
      on: {
        slideChangeTransitionStart: function () {
          $(".one-model-btn").removeClass("active");
          $(".one-model-btn").eq(this.activeIndex).addClass("active");
          $(".one-model-item").removeClass("active");
          $(".one-model-item").eq(this.activeIndex).addClass("active");
          $(".one-model-svg > svg").removeClass("active");
          $(".one-model-svg > svg").eq(this.activeIndex).addClass("active");
        },
      },
      pagination: {
        type: "custom",
        clickable: true,
        el: ".one-model-btnList",
        bulletClass: "one-model-btn",
      },
    });
    // */
    // model End
  
    // 3d Begin
    // /*
    // ScrollTrigger.create({
    //   trigger: ".one-3d-section",
    //   start: "top 50%",
    //   end: "top 30%",
    //   scrub: true,
    //   animation: gsap
    //     .timeline()
    //     .fromTo(".one-3d-filter", { opacity: 0 }, { opacity: 1 })
    //     .fromTo(
    //       ".one-3d-txt",
    //       { marginTop: "5rem", opacity: 0 },
    //       { marginTop: "0em", opacity: 1 }
    //     ),
    // });
    // */
    // 3d End
  
    // precision Begin
    // /*
    $(".one-precision-title p").eq("0").addClass("active");
    $(".one-precision-btn").eq("0").addClass("active");
    $(".one-precision-des p").eq("0").addClass("active");
    const precision = new Swiper(".one-precision-swiper", {
      autoplay: {
        delay: 3000,
        disableOnInteraction: false,
      },
      spaceBetween: 0,
      on: {
        slideChangeTransitionStart: function () {
          $(".one-precision-btn")
            .removeClass("active")
            .eq(this.activeIndex)
            .addClass("active");
          $(".one-precision-des>p")
            .removeClass("active")
            .eq(this.activeIndex)
            .addClass("active");
          $(".one-precision-title>p").removeClass("active");
          $(".one-precision-title>p").eq(this.activeIndex).addClass("active");
          document.querySelector(".one-precision-btn.active")?.scrollIntoView({
            behavior: "smooth",
            block: "nearest",
            inline: "center",
          });
        },
      },
    });
    document
      .querySelector(".one-precision-btnList")
      .addEventListener("click", function (e) {
        const btn = e.target.closest(".one-precision-btn");
        if (btn) {
          const index = [...btn.parentNode.children].indexOf(btn);
          precision.slideTo(index);
        }
      });
    // */
    // precision End
  
    // system Begin
    // /*
    var systemAnimate1;
    ScrollTrigger.create({
      trigger: ".one-system-section",
      start: "top bottom",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-system-img1", {
        onStart: function () {
          window.ONE.keyAnimate(".one-system-img1", 1, 60, 20).then(function (re) {
            systemAnimate1 = re;
            systemAnimate1?.from(1, 1);
          });
        },
      }),
    });
    var systemAnimate2;
    ScrollTrigger.create({
      trigger: ".one-system-img-2",
      start: "top bottom",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-system-img2", {
        onStart: function () {
          window.ONE.keyAnimate(".one-system-img-2", 1, 60, 20).then(function (re) {
            systemAnimate2 = re;
            systemAnimate2?.from(1, 1);
          });
        },
      }),
    });
    var systemAnimate3;
    ScrollTrigger.create({
      trigger: ".one-system-img-3",
      start: "top bottom",
      end: "+=10",
      scrub: true,
      animation: gsap.timeline().to(".one-system-img2", {
        onStart: function () {
          window.ONE.keyAnimate(".one-system-img-3", 1, 60, 20).then(function (re) {
            systemAnimate3 = re;
            systemAnimate3?.from(1, 1);
          });
        },
      }),
    });
    // */
    // system End
  
    // eyeglasses Begin
    // /*
    $(".one-eyeglasses-btn").eq(0).addClass("active");
    // $(".one-eyeglasses-button").click(function () {
    //   $(".one-eyeglasses-popup").addClass("active");
    //   eyeglassesSwiper.enable();
    // });
    // $(".one-eyeglasses-nopopup").click(function () {
    //   $(".one-eyeglasses-popup").removeClass("active");
    //   eyeglassesSwiper.disable();
    // });
    // var eyeglassesSwiper = new Swiper(".one-eyeglasses-swiper", {
    //   autoplay: {
    //     delay: 3000, // 设置轮播的延迟时间
    //     disableOnInteraction: true,
    //   },
    //   spaceBetween: 20,
    //   on: {
    //     slideChangeTransitionStart: function () {
    //       $(".one-eyeglasses-btn").removeClass("active");
    //       $(".one-eyeglasses-btn").eq(this.activeIndex).addClass("active");
    //     },
    //   },
    //   navigation: {
    //     prevEl: ".one-eyeglasses-pagebtn.left",
    //     nextEl: ".one-eyeglasses-pagebtn.right",
    //     disabledClass: "disabled",
    //   },
    // });
    // eyeglassesSwiper.disable();
  
    ScrollTrigger.create({
      trigger: ".one-eyeglasses-section",
      start: "top bottom",
      end: "70% bottom",
      toggleActions: "none play none reset",
      animation: gsap
        .timeline()
        .fromTo(
          ".one-eyeglasses-img-2",
          { marginLeft: "0em", top: "7.1rem", opacity: 0 },
          { marginLeft: "-4.25rem", top: "1.75rem", opacity: 1 }
        )
        .fromTo(
          ".one-eyeglasses-img-3",
          { marginLeft: "0em", top: "7.1rem", opacity: 0 },
          { marginLeft: "-7rem", top: "5.88rem", opacity: 1 },
          "<"
        )
        .fromTo(
          ".one-eyeglasses-img-4",
          { marginLeft: "0em", top: "7.1rem", opacity: 0 },
          { marginLeft: "-7rem", top: "13.4rem", opacity: 1 },
          "<"
        )
        .fromTo(
          ".one-eyeglasses-img-5",
          { marginLeft: "0em", top: "7.1rem", opacity: 0 },
          { marginLeft: "-4rem", top: "17.1rem", opacity: 1 },
          "<"
        )
        .fromTo(
          ".one-eyeglasses-img-6",
          { marginLeft: "0em", top: "7.1rem", opacity: 0 },
          { marginLeft: "1rem", top: "0.75rem", opacity: 1 },
          "<"
        )
        .fromTo(
          ".one-eyeglasses-img-7",
          { marginLeft: "0em", top: "7.1rem", opacity: 0 },
          { marginLeft: "6rem", top: "3rem", opacity: 1 },
          "<"
        )
        .fromTo(
          ".one-eyeglasses-img-8",
          { marginLeft: "0em", top: "7.1rem", opacity: 0 },
          { marginLeft: "6.5rem", top: "10.15rem", opacity: 1 },
          "<"
        )
        .fromTo(
          ".one-eyeglasses-img-9",
          { marginLeft: "0em", top: "7.1rem", opacity: 0 },
          { marginLeft: "4rem", top: "16.45rem", opacity: 1 },
          "<"
        )
        .fromTo(".one-eyeglasses-button", { opacity: 0 }, { opacity: 1 }, "<"),
    });
  
    window.ONE.initPopup(".one-eyeglasses-button", ".one-eyeglasses-popup");
    // */
    // eyeglasses End
  
    // partner Begin
    // /*
    var partnerSwiper = new Swiper(".one-partner-swiper", {
      slidesPerView: 5,
      centeredSlides: true,
      loop: true,
      spaceBetween: 0,
      // autoplay: {
      // 	delay: 3000, // 设置轮播的延迟时间
      // 	disableOnInteraction: true,
      // },
      on: {
        slideChangeTransitionStart: function () {
          $(".one-partner-swiper-item").removeClass("active");
          $(".one-partner-swiper-item").eq(this.activeIndex).addClass("active");
        },
      },
      navigation: {
        prevEl: ".one-partner-swiperList .one-partner-left",
        nextEl: ".one-partner-swiperList .one-partner-right",
        disabledClass: "disabled",
      },
    });
    // */
    // partner End
  
    // review Begin
    // /*
    $(".one-review-btn").click(function () {
      if ($(this).hasClass("active")) {
        $(this).removeClass("active");
        $(this).parent().find(".one-review-info").hide();
      } else {
        $(this).addClass("active");
        $(this).parent().find(".one-review-info").show();
      }
    });
    new Swiper(".one-review-swiper", {
      autoplay: {
        delay: 3000, // 设置轮播的延迟时间
        disableOnInteraction: true,
      },
      spaceBetween: 50,
      navigation: {
        prevEl: ".one-review-pagebtn.left",
        nextEl: ".one-review-pagebtn.right",
        disabledClass: "disabled",
      },
    });
    // */
    // review End
  
  }
  